module RongCloud
  module Apis
    module Group
      # store group id as hash key, while group name as value
      # { 132 => "damn group name" }
      def sync_group(user_id, groups)
        params = {userId: user_id}
        groups.each do |id, name|
          params["group#{id}"] = name
        end
        request("/group/sync", params)
      end

      def create_group(user_id, group_id, group_name)
        request("/group/create", userId: user_id, groupId: group_id, groupName: group_name)
      end

      def join_group(user_id, group_id. group_name)
        request("/group/join", userId: user_id, groupId: group_id, groupName: group_name)
      end

      def quit_group(user_id, group_id)
      end



    end # end Group
  end # end Apis
end # end RongCloud
